package com.abing.starry.service;

import com.abing.api.model.StarryApiRequest;
import com.abing.starry.model.entity.InterfaceInfoEntity;
import com.abing.starry.model.request.interfaces.QueryCountRequest;
import com.abing.starry.model.request.interfaces.QueryInterfaceRequest;
import com.abing.starry.model.vo.InterfaceInfoVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* @author 阿炳亿点点帅
* @description 针对表【interface_info(接口信息)】的数据库操作Service
* @createDate 2024-08-23 15:16:51
*/
public interface InterfaceInfoService extends IService<InterfaceInfoEntity> {

    /**
     * 调用接口
     * @param starryApiRequest
     * @return
     */
    String apiInvoke(StarryApiRequest starryApiRequest);

    /**
     * 分页查询接口
     * @param queryInterfaceRequest
     * @return
     */
    IPage<InterfaceInfoEntity> queryInterfaceByPage(QueryInterfaceRequest queryInterfaceRequest);

    /**
     * 查询接口首页调用次数信息
     * @param queryCountRequest
     * @return
     */
    IPage<InterfaceInfoVO> queryInvokeCountByPage(QueryCountRequest queryCountRequest);

    /**
     * 申请接口
     * @param id
     * @param isAgree
     * @return
     */
    boolean applyInterface(String id,Boolean isAgree);

    /**
     * 新增接口
     * @param interfaceInfoEntity
     * @return
     */
    boolean saveInterface(InterfaceInfoEntity interfaceInfoEntity);
}
